home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat5 / grio.z / grio
Encoding:
Text File  |  2002-10-03  |  15.7 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ggggrrrriiiioooo((((5555))))                                                                ggggrrrriiiioooo((((5555))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      grio - guaranteed-rate I/O
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      Guaranteed-rate I/O (GRIO) refers to a guarantee made by the system to a
  13.      user process indicating that the given process will receive data from a
  14.      system resource at a predefined rate regardless of any other activity on
  15.      the system.  The purpose of this mechanism is to manage the sharing of
  16.      scarce I/O resources amongst a number of competing processes, and to
  17.      permit a given process to reserve a portion of the system's resources for
  18.      its exclusive use for a period of time.
  19.  
  20.      Currently, the only system resources that can be reserved using the GRIO
  21.      mechanism are files stored on an XFS filesystem.
  22.  
  23.      A GRIO guarantee is defined as the number of bytes that can be read or
  24.      written to a given file by a given process over a set period of time.  If
  25.      a process has a GRIO guarantee on a file, it can write data to or read
  26.      data from the file at the guaranteed rate regardless of other I/O
  27.      activity on the system.  If the process issues I/O requests at a size or
  28.      rate greater than the guarantee, the behavior of the system is determined
  29.      by the type of rate guarantee. The excess requests  may be blocked until
  30.      such time as they fall within the scope of the guarantee, or the requests
  31.      may be allowed up to the limit of the device bandwidth before that are
  32.      blocked.
  33.  
  34.      The following types of rate guarantees are supported:
  35.  
  36.      _PPPP_EEEE_RRRR______FFFF_IIII_LLLL_EEEE______GGGG_UUUU_AAAA_RRRR       - the GRIO reservation is associated with a
  37.                            single file and may not be transferred
  38.      _PPPP_EEEE_RRRR______FFFF_IIII_LLLL_EEEE______SSSS_YYYY_SSSS______GGGG_UUUU_AAAA_RRRR   - the GRIO reservation may be transferred to any
  39.                            file on a given file system
  40.  
  41.      _PPPP_RRRR_OOOO_CCCC______PPPP_RRRR_IIII_VVVV_AAAA_TTTT_EEEE______GGGG_UUUU_AAAA_RRRR   - the GRIO reservation may not transferred to
  42.                            another process
  43.      _PPPP_RRRR_OOOO_CCCC______SSSS_HHHH_AAAA_RRRR_EEEE______GGGG_UUUU_AAAA_RRRR     - the GRIO reservation may be transferred to
  44.                            another process
  45.  
  46.      _FFFF_IIII_XXXX_EEEE_DDDD______RRRR_OOOO_TTTT_OOOO_RRRR______GGGG_UUUU_AAAA_RRRR    - the GRIO reservation is the VOD (ie. ROTOR)
  47.                            type of reservation and the rotor position is
  48.                            established at the start of the reservation
  49.      _SSSS_LLLL_IIII_PPPP______RRRR_OOOO_TTTT_OOOO_RRRR______GGGG_UUUU_AAAA_RRRR     - the GRIO reservation is the VOD (ie. ROTOR)
  50.                            type of reservation and the rotor position will
  51.                            vary according to the access pattern of the
  52.                            process
  53.      _NNNN_OOOO_NNNN______RRRR_OOOO_TTTT_OOOO_RRRR______GGGG_UUUU_AAAA_RRRR      - the GRIO reservation is a regular
  54.                            (ie. NONROTOR) type of reservation
  55.  
  56.      _RRRR_EEEE_AAAA_LLLL_TTTT_IIII_MMMM_EEEE______SSSS_CCCC_HHHH_EEEE_DDDD______GGGG_UUUU_AAAA_RRRR - the GRIO reservation specifies the rate at
  57.                            which data will be provided to the process
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggrrrriiiioooo((((5555))))                                                                ggggrrrriiiioooo((((5555))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.      _NNNN_OOOO_NNNN______SSSS_CCCC_HHHH_EEEE_DDDD______GGGG_UUUU_AAAA_RRRR      - the I/O requests associated with the GRIO
  78.                            reservation are non-scheduled, this will
  79.                            affect other GRIO reservations on the system
  80.  
  81.      Only one GRIO reservation characteristic may be chosen from each group.
  82.      The PPPPRRRROOOOCCCC____SSSSHHHHAAAARRRREEEE____GGGGUUUUAAAARRRR, non RRRREEEEAAAALLLLTTTTIIIIMMMMEEEE____SSSSCCCCHHHHEEEEDDDD____GGGGUUUUAAAARRRR, and NNNNOOOONNNN____RRRROOOOTTTTOOOORRRR____GGGGUUUUAAAARRRR
  83.      characteristics are set by default.
  84.  
  85.      There are a number of components in the GRIO mechanism.  The first is the
  86.      guarantee-granting daemon, _g_g_d. This is a user level process that is
  87.      started when the system is booted.  It controls the granting of
  88.      guarantees, the initiation and expiration of existing guarantees, and the
  89.      monitoring of the available bandwidths of each I/O device on the system.
  90.      User processes communicate with the daemon via the grio library using the
  91.      following calls:
  92.  
  93.      _gggg_rrrr_iiii_oooo______aaaa_ssss_ssss_oooo_cccc_iiii_aaaa_tttt_eeee______ffff_iiii_llll_eeee_((((_))))        - associate a file with a guarantee
  94.      _gggg_rrrr_iiii_oooo______qqqq_uuuu_eeee_rrrr_yyyy______ffff_ssss_((((_))))              - query filesystem
  95.      _gggg_rrrr_iiii_oooo______aaaa_cccc_tttt_iiii_oooo_nnnn______llll_iiii_ssss_tttt_((((_))))           - issue list of GRIO reservation requests
  96.      _gggg_rrrr_iiii_oooo______rrrr_eeee_ssss_eeee_rrrr_vvvv_eeee______ffff_iiii_llll_eeee_((((_))))          - issue GRIO reservation request
  97.      _gggg_rrrr_iiii_oooo______rrrr_eeee_ssss_eeee_rrrr_vvvv_eeee______ffff_ssss_((((_))))            - issue GRIO reservation request
  98.      _gggg_rrrr_iiii_oooo______uuuu_nnnn_rrrr_eeee_ssss_eeee_rrrr_vvvv_eeee______bbbb_wwww_((((_))))          - remove grio reservation
  99.  
  100.      When _g_g_d is started, it reads the file /_e_t_c/_g_r_i_o__d_i_s_k_s and uses its
  101.      inbuilt system knowledge to determine the bandwidths of the various
  102.      devices on the system.  The /_e_t_c/_g_r_i_o__d_i_s_k_s file may be edited by the
  103.      system administrator to tune performance.  If _g_g_d is terminated, all
  104.      existing rate guarantees are removed.
  105.  
  106.      The next component of the GRIO mechanism is the XLV volume manager.  Rate
  107.      guarantees may be obtained from files on the real-time and non-realtime
  108.      subvolumes of an XFS filesystem as well as non-XLV disk partitions having
  109.      XFS filesystems.  The disk driver command retry mechanism is disabled on
  110.      the disks that make up the real-time subvolume.  This means that if a
  111.      drive error occurs, the data is lost.  The intent of real-time files is
  112.      to read/write data from the disk as rapidly as possible.  If the device
  113.      driver is forced to retry one process's disk request, it causes the
  114.      requests from other processes to become delayed.
  115.  
  116.      If one partition of a disk is used in a real-time subvolume, the entire
  117.      disk is considered to be used for real-time operation.  If one disk on a
  118.      SCSI controller is  used for real-time operation then all the other
  119.      devices on that controller must be used for real-time operation as well.
  120.  
  121.      In order to use the guaranteed-rate I/O mechanism effectively, the XLV
  122.      volume and XFS filesystem must be set up properly.  The next section
  123.      gives an example.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ggggrrrriiiioooo((((5555))))                                                                ggggrrrriiiioooo((((5555))))
  137.  
  138.  
  139.  
  140.      By default, the _g_g_d daemon will allow four process streams to obtain rate
  141.      guarantees. If support for more streams is desired, it is necessary to
  142.      obtain licenses for the additional streams.  The license information is
  143.      stored in the /_u_s_r/_v_a_r/_n_e_t_l_s/_n_o_d_e_l_o_c_k file and interpreted by the _g_g_d
  144.      daemon on startup.
  145.  
  146.      While configuring a system that will be used for guaranteed rate I/O, it
  147.      is important to recognize that the system setup can affect grio. For
  148.      example, if non standard disk drives are added and the _g_r_i_o__d_i_s_k_s file
  149.      updated, this might have an impact on the performance of the SCSI
  150.      controllers (which should then be tuned thru _g_r_i_o__d_i_s_k_s).  Also, it is
  151.      recommended that the real time disks to which grio is needed should be
  152.      placed all by themselves on the SCSI bus. This is becauses devices like
  153.      CDROMs and tapes might hold up the bus if accessed while a grio request
  154.      is being serviced. Grio does not model file system meta data writes, so
  155.      keeping the data and log volumes of the XLV on different SCSI busses from
  156.      the real time disks help in satisfying the guarantees. For real time
  157.      disks, it is strongly recommended that the disks be partitioned to have
  158.      only one partition, the real time partition. Finally, some system
  159.      components are used for I/O as well as other data traffic, so it is
  160.      important to not overload these components with other data requests while
  161.      grio requests are being serviced.
  162.  
  163. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  164.      The example in this section describes a method of laying out the disks,
  165.      filesystem, and real-time file that enables the greatest number of
  166.      processes to obtain guarantees on a single file concurrently.  It is not
  167.      necessary to construct a file in this manner in order to use GRIO,
  168.      however fewer processes can obtain rate guarantees on the file as a
  169.      result.  It is also not necessary to use a real-time file, however
  170.      guarantees obtained on non-real time files can only be considered to be
  171.      "soft" guarantees at best which may not be sufficient for some
  172.      applications.  Assume that there are four disk partitions available for
  173.      the real-time subvolume of an XLV volume.  Each one of the partitions is
  174.      on a different physical disk.
  175.  
  176.      Before setting up the XFS filesystem, the I/O request size used by the
  177.      user process must be determined.  In order to get the greatest I/O rate,
  178.      the file data should be striped across all the disks in the subvolume.
  179.      To avoid filesystem fragmentation and to force all I/O operations to be
  180.      on stripe boundaries, the file extent size should be an even multiple of
  181.      the volume stripe width.  Rate guarantees should be made with sizes equal
  182.      to even multiples of I/O request sizes.  All I/O request sizes must be
  183.      even multiples of the optimal I/O size of the underlying disk devices.
  184.      The optimal I/O size is specified on a per device basis in the
  185.      /_e_t_c/_g_r_i_o__d_i_s_k_s. The disk device characteristics for optimal I/O sizes of
  186.      64k, 128k, 256k, and 512k bytes are supplied.  The _g_r_i_o__b_a_n_d_w_i_d_t_h(_1_M)
  187.      utility can be used to determine the device characteristics for different
  188.      optimal I/O sizes.  For simplicity, this example will use an optimal I/O
  189.      size of 64K bytes.  Also, the stripe size of the XLV realtime subvolume
  190.      for this file system will be set to an even multiple of 64K bytes.  If
  191.      there are four disks available, let the stripe step size be equal to 64k
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ggggrrrriiiioooo((((5555))))                                                                ggggrrrriiiioooo((((5555))))
  203.  
  204.  
  205.  
  206.      bytes, and the volume stripe width be 256k bytes.  The file extent size
  207.      should be set to a multiple of the volume stripe width.  In this example,
  208.      let the file extent size be equal to the stripe width.  Assume that the
  209.      application always issues I/O requests in sizes equal to the extent size.
  210.  
  211.      Once the XLV volume and XFS filesystem have been created, the application
  212.      can create the real-time file.  Real-time files must be read or written
  213.      using direct, synchronous I/O requests. (This is also true for GRIO
  214.      accesses to non-real time files.)  The _o_p_e_n(2) manual page describes the
  215.      use and buffer alignment restrictions when using direct I/O.  When
  216.      creating a real-time file, the FFFF____FFFFSSSSSSSSEEEETTTTXXXXAAAATTTTTTTTRRRR command must be issued to set
  217.      the XXXXFFFFSSSS____XXXXFFFFLLLLAAAAGGGG____RRRREEEEAAAALLLLTTTTIIIIMMMMEEEE flag.  This can only be issued on a newly created
  218.      file.  It is not possible to mark a file as real-time once non-real-time
  219.      data blocks have been allocated to it.
  220.  
  221.      After the real-time file has been created, the application can issue
  222.      _g_r_i_o__r_e_s_e_r_v_e__f_s(_3_X)] and _g_r_i_o__a_s_s_o_c_i_a_t_e__f_i_l_e(_3_x) pair, to obtain the rate
  223.      guarantee.  Once the rate guarantee is established, any read or write
  224.      requests that the application issues to the file will be completed within
  225.      the parameters of the guarantee.  This will continue until the file is
  226.      closed, the guarantee is removed by the application via
  227.      _g_r_i_o__u_n_r_e_s_e_r_v_e__b_w(3X), or the guarantee expires.
  228.  
  229.      Any process can use the _g_r_i_o__a_s_s_o_c_i_a_t_e__f_i_l_e() call to switch the GRIO
  230.      reservation to itself if the PPPPRRRROOOOCCCC____SSSSHHHHAAAARRRREEEE____GGGGUUUUAAAARRRR characteristic is set. This
  231.      causes the first process to lose the rate guarantee and the second
  232.      process to receive it.  Similarly, the _g_r_i_o__a_s_s_o_c_i_a_t_e__f_i_l_e() call can be
  233.      used to switch the GRIO reservation from one file to another, within the
  234.      same filesystem, if the PPPPEEEERRRR____FFFFIIIILLLLEEEE____SSSSYYYYSSSS____GGGGUUUUAAAARRRR characteristic is set.
  235.  
  236. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  237.      If a rate cannot be guaranteed, _g_g_d returns an error to the requesting
  238.      process.  It also returns the amount of bandwidth currently available on
  239.      the device.  The process can then determine if this amount is sufficient
  240.      and if so issue another rate guarantee request.
  241.  
  242. FFFFIIIILLLLEEEESSSS
  243.      /etc/grio_disks
  244.      /usr/var/netls/nodelock
  245.  
  246. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  247.      ggd(1M), grio(1M), grio_bandwidth(1M), grio_associate_file(3X),
  248.      grio_query_fs(3X), grio_action_list(3X), grio_reserve_file(3X),
  249.      grio_reserve_fs(3X), grio_unreserve_bw(3X), grio_disks(4)
  250.  
  251. NNNNOOOOTTTTEEEESSSS
  252.      To make grio more secure, processes requesting guaranteed rate I/O need
  253.      the priviledge of CAP_DEVICE_MGMT or root permissions, else their
  254.      requests will fail.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.